import request from '@/utils/request'

// 1获取店铺信息
export function getShopDetail(data) {
  return request({
    url: '/store/getShopDetail',
    method: 'post',
    data
  })
}

// 2编辑店铺信息
export function logoEdit(data) {
  return request({
    url: '/store/logoEdit',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
      'type': 'upfile'
    },
    data,
    transformRequest: [function(data, headers) {
      const formData = new FormData()
      for (const key of Object.keys(data)) {
        formData.append(key, data[key])
      }
      return formData
    }]
  })
}

// 3获取店铺用户列表
export function memberList(data) {
  return request({
    url: '/store/memberList',
    method: 'post',
    data
  })
}

// 4新增员工
export function memberAdd(data) {
  return request({
    url: '/store/memberAdd',
    method: 'post',
    data
  })
}

// 5 获取员工详情
export function memberDetails(data) {
  return request({
    url: '/store/memberDetails',
    method: 'post',
    data
  })
}

// 6编辑员工
export function memberEdit(data) {
  return request({
    url: '/store/memberEdit',
    method: 'post',
    data
  })
}

// 7删除员工
export function delMember(data) {
  return request({
    url: '/store/delMember',
    method: 'post',
    data
  })
}

// 8重置密码
export function repasswordMember(data) {
  return request({
    url: '/store/repasswordMember',
    method: 'post',
    data
  })
}

// 9运费设置获取区域
export function area(data) {
  return request({
    url: '/store/area',
    method: 'post',
    data
  })
}

// 10获取店铺当前运费设置信息
export function fareTemplateDetails(data) {
  return request({
    url: '/store/fareTemplateDetails',
    method: 'post',
    data
  })
}

// 11新增店铺运费模块
export function areaAdd(data) {
  return request({
    url: '/store/areaAdd',
    method: 'post',
    data
  })
}

// 12保存店铺运费模块
export function areaEdit(data) {
  return request({
    url: '/store/areaEdit',
    method: 'post',
    data
  })
}

// 13删除店铺运费模块
export function areaDel(data) {
  return request({
    url: '/store/areaDel',
    method: 'post',
    data
  })
}
